home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / std_unix / archive / text0087.txt < prev    next >
Encoding:
Text File  |  1993-07-06  |  1.4 KB  |  36 lines

  1. Submitted-by: jazz@hal.com (Jason Zions)
  2.  
  3. In article <20iskbINN34t@rodan.UU.NET> lwv26@cas.org (Larry W. Virden) writes:
  4. >>Strictly conforming applications don't try to read() directories
  5. >>with the assumption that they're doing something equivalent to readdir(),
  6. >>since the standard doesn't say they can; however, a strictly-conforming
  7. >>application is allowed to read() a directory for any purpose.
  8. >
  9. >So an application needs to do a stat first and determine whether the file
  10. >type is one which is permitted to be read() before doing the reading?
  11.  
  12. No. According to 1003.1, *all* file types may be read(). It's only when you
  13. add NFS and try to access files over NFS that the standard becomes
  14. irrelevant, and can detect whatever it wants to however it wants to (wait
  15. for read() to fail with EISDIR or stat() before open()).
  16.  
  17. >  Moving
  18. >back to the question of the grep -s - is it then permitted for grep to
  19. >be silent about the fact that one of the arbitrary character string arguments
  20. >is a directory that is being skipped?
  21.  
  22. I think so, but this is just my opinion.
  23.  
  24. >I guess someone will have to write up one of the interpretation requests.
  25.  
  26. That's the only way to get a definitive answer. In the interp request, be
  27. sure to point out that the system in question is not 1003.1-conforming, and
  28. that the system prohibits read() of a directory.
  29.  
  30. Jason Zions
  31. Not an official opinion of any entity other than the author
  32.  
  33.  
  34. Volume-Number: Volume 31, Number 89
  35.  
  36.